package neca.tmazo.vista.vistaGUI;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import neca.tmazo.datasets.Music;
import neca.tmazo.datasets.Song;

/**
 * 
 * @author neca
 *
 */
public class MiniaturaMusica extends JPanel {

	/**
	 * Create the panel.
	 * 
	 * 
	 * @param music Objeto music del que se desea mostrar autor y titulo 
	 */
	public MiniaturaMusica(Music music) {
		setBackground(Color.LIGHT_GRAY);
		
		setLayout(null);
		setPreferredSize(new Dimension(360, 75));
		
		ImageIcon miniaturaIcon= (music instanceof Song) ? 
									ImageManager.getImage(ImageManager.IMAGE_SONG) :
									ImageManager.getImage(ImageManager.IMAGE_ALBUM) ;
		JLabel icono = new JLabel(miniaturaIcon);
		icono.setBounds(10, 10, 50, 50);
		add(icono);
		
		JLabel textPane = new JLabel();
		textPane.setForeground(Color.DARK_GRAY);
		textPane.setText("Autor:");
		textPane.setFont(new Font("Tahoma", Font.BOLD, 13));
		textPane.setBounds(88, 10, 49, 20);
		add(textPane);
		
		JLabel textPane_1 = new JLabel();
		textPane_1.setForeground(Color.DARK_GRAY);
		textPane_1.setText(music.getAuthor());
		textPane_1.setFont(new Font("Tahoma", Font.PLAIN, 13));
		textPane_1.setBounds(147, 10, 203, 20);
		add(textPane_1);
		
		JLabel textPane_2 = new JLabel();
		textPane_2.setForeground(Color.DARK_GRAY);
		textPane_2.setText("Titulo:");
		textPane_2.setFont(new Font("Tahoma", Font.BOLD, 13));
		textPane_2.setBounds(88, 40, 49, 20);
		add(textPane_2);
		
		JLabel textPane_3 = new JLabel();
		textPane_3.setForeground(Color.DARK_GRAY);
		textPane_3.setText(music.getTitle());
		textPane_3.setFont(new Font("Tahoma", Font.PLAIN, 13));
		textPane_3.setBounds(147, 40, 203, 20);
		add(textPane_3);
		

	}

}
